#pragma once

#include "PlugInEnum.h"
#include "plugin.h"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <utility>
#include <unordered_map>
#include <string>
#include <process.h>
#include <atomic>
#include <fstream>
#include <tuple>
#include <mutex>  
#include <initializer_list>
#include <algorithm>
#include <omp.h>
#include <functional>
#include "Foundation.h"
#include "TinyXML/tinyxml.h"
#include "TList.h"
#include "ThreadPool.h"


#ifdef WIN32
#include <windows.h>
#endif // WIN32

#pragma comment(lib, "Lua535.lib")
#pragma comment(lib, "TinyXML.lib")
#pragma comment(lib, "libfbxsdk.lib")
#pragma comment(lib, "libfbxsdk-md.lib")
#pragma comment(lib, "libxml2-md.lib")
#define CastTo(pObject, type) dynamic_cast<type>(pObject);

#define SafeDeleteArray( pObject ) \
	if(pObject != nullptr)\
	{\
		delete[] pObject;\
		pObject = nullptr;\
	}

#define SafeDelete( pObject ) \
	if(pObject != nullptr)\
	{\
		delete pObject;\
		pObject = nullptr;\
	}

#define SafeRelease( pObject ) \
	if(pObject != nullptr)\
	{\
		pObject->Release();\
		pObject = nullptr;\
	}

#include "TSingle.h"
#include "Refcount.h"

namespace mini
{
	enum RendererType
	{
		DeferredRenderer = 1 << 1,
		FrontRenderer = 1 << 2,
		ParticleRenderer = 1 << 3,
		ShadowRenderer = 1 << 4,
		PostRenderer = 1 << 5,
		GuiRenderer = 1 << 6,
		SkinRenderer = 1 << 7,
		UnknowType = 255,
	};
}

typedef char                CHAR;
typedef signed char         INT8;
typedef unsigned char       UCHAR;
typedef unsigned char       UINT8;
typedef unsigned char       BYTE;
typedef short               SHORT;
typedef signed short        INT16;
typedef unsigned short      USHORT;
typedef unsigned short      UINT16;
typedef unsigned short      WORD;
typedef int                 INT;
typedef signed int          INT32;
typedef unsigned int        UINT;
typedef unsigned int        UINT32;
typedef long                LONG;
typedef unsigned long       ULONG;
typedef unsigned long       DWORD;
typedef __int64             LONGLONG;
typedef __int64             LONG64;
typedef signed __int64      INT64;
typedef unsigned __int64    ULONGLONG;
typedef unsigned __int64    DWORDLONG;
typedef unsigned __int64    ULONG64;
typedef unsigned __int64    DWORD64;
typedef unsigned __int64    UINT64;